package com.example.springbootrocketmq.demo;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;

/**
 * @Auther: 郭敬仰
 * @Date: 2019/8/24 14:59
 * @Description:创建toptic
 */
public class TopicDemo {
    public static void main(String[] args) throws MQClientException {
        DefaultMQProducer producer = new DefaultMQProducer("HAOKE_IM");
        producer.setNamesrvAddr("192.168.64.128:9876");
        producer.start();
        producer.createTopic("broker_haoke_im", "haoke_im_topic", 8);
        System.out.println("创建topic成功");
        producer.shutdown();
    }
}
